<template>
  <view class="container">
    <view class="common_cell">
      <u-cell title="名字" :border="false">
        <view slot="value" class="u-cell-left">
          <u--input inputAlign="right" placeholder="请输入您的名字" border="none" v-model="form.name"></u--input>
        </view>
      </u-cell>
    </view>
    <view class="common_cell">
      <u-cell title="手机号" :border="false">
        <view slot="value" class="u-cell-left">
          <u--input v-model="form.phone" inputAlign="right" placeholder="请输入您的手机号" border="none" />
        </view>
      </u-cell>
    </view>

    <view class="common_cell">
      <u-cell title="邮箱" :border="false">
        <view slot="value" class="u-cell-left">
          <u--input inputAlign="right" placeholder="请输入您的邮箱" v-model="form.email" border="none"></u--input>
        </view>
      </u-cell>
    </view>
    <view class="common_cell">
      <u-cell title="备注" :border="false">
        <view slot="value" class="u-cell-left">
          <u--input inputAlign="right" v-model="form.remark" placeholder="请输入备注" border="none"></u--input>
        </view>
      </u-cell>
    </view>

    <view class="confirm_recharge">
      <view class="confirm_recharge_text">提交</view>
    </view>
  </view>
</template>

<script>
import { addAgent } from "@/api/index";
export default {
  components: {},
  data() {
    return {
      // 页面参数
      options: {},
      form: {
        // 名字
        name: "",
        // 手机号
        phone: "",
        // 邮箱
        email: "",
        // 备注
        remark: ""
      }
    };
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) { },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow() { },

  methods: {

    // 申请代理
    async apply() {
      try {
        await addAgent({
          name: this.form.name,
          phone: this.form.phone,
          email: this.form.email,
          remark: this.form.remark
        })
        uni.showToast({
          title: "申请成功",
          icon: "success",
          duration: 2000
        });
      } catch (error) {

      }
    },

  },
};
</script>

<style lang="scss" scoped>
.container {
  background: rgba(255, 255, 255, 1);
}

.confirm_recharge {
  height: 83.523rpx;
  border-radius: 42.614rpx;
  background: #60a4f7;
  display: flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  bottom: 85.227rpx;
  width: 80%;
  left: 10%;

  .confirm_recharge_text {
    font-family: "Microsoft YaHei";
    font-size: 25.568rpx;
    font-weight: 400;
    line-height: 34.006rpx;
    text-align: left;
    color: #ffffff;
  }
}
</style>